//
//  LCGolbalPageTitleCell.m
//  lechuang
//
//  Created by Mr_hi on 2024/8/27.
//  Copyright © 2024 Mooyi. All rights reserved.
//

#import "LCGolbalPageTitleCell.h"


@interface LCGolbalPageTitleCell ()

@property (nonatomic, strong) UIButton *tagView;

@end


@implementation LCGolbalPageTitleCell

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self initCustomCell];
    }
    return self;
}

- (void)initCustomCell {
    self.textLabel.hidden = YES;
    self.tagView = [UIButton buttonWithType:UIButtonTypeCustom];
    self.tagView.backgroundColor = [UIColor colorWithHexString:@"#FFFFFF"];
    [self.tagView quickSetViewRoundCornWithCorneradius:19 andDerection:UIRectCornerAllCorners];
    self.tagView.titleLabel.font = [UIFont systemFontOfSize:15];
    [self.tagView setTitleColor:[UIColor colorWithHexString:@"#222222"] forState:UIControlStateNormal];
    [self.tagView setTitleColor:[UIColor colorWithHexString:@"#FFFFFF"] forState:UIControlStateSelected];

    self.tagView.userInteractionEnabled = NO;
    [self.contentView addSubview:self.tagView];
}

-(void)layoutSubviews {
    [super layoutSubviews];
    self.tagView.frame = CGRectMake(0, 12, self.bounds.size.width, 38);
}

- (void)setTitle:(NSString *)title {
    [self.tagView setTitle:title forState:UIControlStateNormal];
}

- (void)configCellOfSelected:(BOOL)selected {
    self.tagView.selected = selected;
    if (selected) {
        self.tagView.backgroundColor = [UIColor colorWithHexString:@"#16A1E3"];
    } else {
        self.tagView.backgroundColor = [UIColor colorWithHexString:@"#FFFFFF"];
    }
}

//通过此父类方法配置cell动画
- (void)showAnimationOfProgress:(CGFloat)progress type:(XLPageTitleCellAnimationType)type {
}


@end
